#include <iostream>
#include <cstring>

void match(char *text, char *pattern) {
	char *pt = text;
	char *pp = pattern;
	while (*pt) {
		if (*pt==*pp) {
			char *pt2 = pt;
			while (*++pp == *++pt2) { }
			if (!*pp) {
				std::cout<<pt<<std::endl;
				pp = pattern;
			}
		}
		++pt;
	} 
}

int main(){
	char *text = "hello,junix.LLLJJJJJunix junixmmmmmm";
	char *pattern = "junix";
	match(text, pattern);
}
